package dexter.testing;

import java.io.Serializable;
import java.util.Vector;


public class EvaluationValues implements Serializable {

	private static final long serialVersionUID = -6668963663163423076L;
	
	private Vector<Boolean> results;
	private Vector<String>  infos;
	private Logger log;

	/**
	 * Usage params : <log, resBool, resInfo, resBool2, resInfo2, ..., resBoolN, resBoolN>
	 * @param log
	 * @param pairs
	 */
	public EvaluationValues(Logger log, Object ... pairs) {
		
		this.results = new Vector<Boolean>();
		this.infos = new Vector<String>();
		
		boolean alternateType = false;
		
		for(Object elem : pairs) {
			
			if (!alternateType) results.add( (Boolean) elem);
			else infos.add( (String) elem);
			
			alternateType=!alternateType;
		}
		this.log = log;
	}
	
	public boolean getResultValue(int i) {
		int top = infos.size() - 1;
		if (top<0 || top<i) return false;
		return results.get(i);
	}
	
	public String getResultInfo(int i) {
		int top = infos.size() - 1;
		if (top<0 || top<i) return "";
		return infos.get(i);
	}
	
	public Logger getLog() {
		return log;
	}
	
	public int getSize() {
		return results.size();
	}


}